Carbon


ThemeTabTitleDrawProcPtr

Header: Appearance.h Carbon status: Supported

Draws a tab title.

typedef void(* ThemeTabTitleDrawProcPtr) (
    const Rect *bounds, 
    ThemeTabStyle style, 
    ThemeTabDirection direction, 
    SInt16 depth, 
    Boolean isColorDev, 
    UInt32 userData
);

You would declare your function like this if you were to name it MyThemeTabTitleDrawCallback:

void MyThemeTabTitleDrawCallback (
    const Rect *bounds, 
    ThemeTabStyle style, 
    ThemeTabDirection direction, 
    SInt16 depth, 
    Boolean isColorDev, 
    UInt32 userData
);
bounds

A pointer to a structure of type Rect. The rectangle you are passed is set to the area in which you should draw your tab title content. Your tab title drawing function is called clipped to the rectangle in which you are allowed to draw your content; do not draw outside this region.

style

A value of type ThemeTabStyle. You are passed a constant specifying the relative position (front or non-front) and state of the tab. See “Theme Tab Style Constants” for descriptions of possible values.

direction

A value of type ThemeTabDirection. You are passed a constant specifying the direction in which the tab is oriented. See “Theme Tab Direction Constants” for descriptions of possible values.

depth

A signed 16-bit value. You are passed the bit depth (in bits per pixel) of the current graphics port.

isColorDev

A value of type Boolean. If true, indicates that you are drawing on a color device; a value of false indicates a monochrome device.

userData

An unsigned 32-bit value. You are passed data specifying how to draw the tab title content, from the userData parameter of DrawThemeTab.

DISCUSSION

At the time your tab title drawing function is called, the foreground text color and mode is already set to draw in the correct state (active or inactive) and correct color for the theme. You do not need to set the color unless you have special drawing needs. If you do have special drawing needs, you should supply the depth value and the value of the isColorDevice parameter to the function IsThemeInColor to determine whether or not you should draw the tab title content in color. Note that the Appearance Manager calls your MyThemeTabTitleDrawCallback function for every device that the bounds rectangle intersects.

You should refer to your MyThemeTabTitleDrawCallback function using a ThemeTabTitleDrawUPP, which you can create with the NewThemeTabTitleDrawProc macro.

You typically use the NewThemeTabTitleDrawProc macro like this:

ThemeTabTitleDrawUPP myThemeTabTitleDrawUPP;

myThemeTabTitleDrawUPP = NewThemeTabTitleDrawProc(MyThemeTabTitleDrawCallback);

You typically use the CallThemeTabTitleDrawProc macro like this:

CallThemeTabTitleDrawProc(myThemeTabTitleDrawUPP, bounds, style, direction, depth, isColorDev, userData);

SPECIAL CONSIDERATIONS

The Appearance Manager draws the tab background prior to calling your tab title drawing function, so you should not erase the tab background from your title drawing function.

VERSION NOTES

This function is available with Appearance Manager 1.1 and later.

AVAILABILITY

Supported in Carbon.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)